applications of pythagorean theorem